#!/bin/bash
container=gkd-admin                     # 容器名称
port=8081                               # 容器对外端口
registry=gkd.plus:5010                  # 私有库地址
image=gkd/gkd-admin                     # 镜像名称
extra_host=gkd.plus:192.168.1.105       # 需要额外映射的host

docker build -t ${registry}/${image} docker
docker push ${registry}/${image}
docker rm -v -f ${container}
docker run -itd \
  --name=${container} \
  --hostname=${container} \
  --privileged=true \
  --restart=always \
  -p ${port}:80 \
  --add-host ${extra_host} \
  ${registry}/${image}
